<extend name="Public/base-kong"/>
<block name="nav">
  
</block>
<block name="body">
   <ul class="ztree" style="padding:0px;">
    <li> <a title="全部展开、折叠 "><span class="button ico_open2"></span><span id="ztree_expandAll" data-open="false">全部展开、折叠 </span></a> </li>
  </ul>
	<ul id="treeDemo" class="ztree"></ul>

</block>

<block name="plugin-script"> 
 <script type="text/javascript">
Wind.css('zTree');

var setting = {
    data: {
        key: {
            name: "name"
        },
        simpleData: {
            enable: true,
            idKey: "id",
            pIdKey: "parentid",
        }
    },
  
};

		var zNodes ={$json};

	$(function(){
	Wind.use('zTree', function(){
		$.fn.zTree.init($("#treeDemo"), setting, zNodes);
		zTree = $.fn.zTree.getZTreeObj("treeDemo");
		$("#ztree_expandAll").click(function(){
			if($(this).data("open")){
				zTree.expandAll(false);
				$(this).data("open",false);
			}else{
				zTree.expandAll(true);
				$(this).data("open",true);
			}
		});
	
	});
});
		
		
</script>

</block>